# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V2.Model.MerchantOrderReturnItem do
  @moduledoc """


  ## Attributes

  *   `customerReturnReason` (*type:* `GoogleApi.Content.V2.Model.CustomerReturnReason.t`, *default:* `nil`) - The reason that the customer chooses to return an item.
  *   `itemId` (*type:* `String.t`, *default:* `nil`) - Product level item ID. If the returned items are of the same product, they will have the same ID.
  *   `merchantReturnReason` (*type:* `GoogleApi.Content.V2.Model.RefundReason.t`, *default:* `nil`) - The reason that merchant chooses to accept a return item.
  *   `product` (*type:* `GoogleApi.Content.V2.Model.OrderLineItemProduct.t`, *default:* `nil`) - Product data from the time of the order placement.
  *   `returnShipmentIds` (*type:* `list(String.t)`, *default:* `nil`) - IDs of the return shipments that this return item belongs to.
  *   `state` (*type:* `String.t`, *default:* `nil`) - State of the item. Acceptable values are: - "`canceled`" - "`new`" - "`received`" - "`refunded`" - "`rejected`" 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :customerReturnReason => GoogleApi.Content.V2.Model.CustomerReturnReason.t() | nil,
          :itemId => String.t() | nil,
          :merchantReturnReason => GoogleApi.Content.V2.Model.RefundReason.t() | nil,
          :product => GoogleApi.Content.V2.Model.OrderLineItemProduct.t() | nil,
          :returnShipmentIds => list(String.t()) | nil,
          :state => String.t() | nil
        }

  field(:customerReturnReason, as: GoogleApi.Content.V2.Model.CustomerReturnReason)
  field(:itemId)
  field(:merchantReturnReason, as: GoogleApi.Content.V2.Model.RefundReason)
  field(:product, as: GoogleApi.Content.V2.Model.OrderLineItemProduct)
  field(:returnShipmentIds, type: :list)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V2.Model.MerchantOrderReturnItem do
  def decode(value, options) do
    GoogleApi.Content.V2.Model.MerchantOrderReturnItem.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V2.Model.MerchantOrderReturnItem do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
